package com.example.jobback.controller.recruiter;

import com.example.jobback.aspect.RateLimit;
import com.example.jobback.req.recruiter.seeker.RCrossGetGoodSeekerListReq;
import com.example.jobback.resp.recruiter.interest.InterestedSeekerResp;
import com.example.jobback.resp.recruiter.seeker.RCrossGetGoodSeekersResp;
import com.example.jobback.result.Result;
import com.example.jobback.service.recruiter.RecruiterSeekerService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @ClassName: RecruiterSeekerController
 * @Description:招聘者推荐牛人服务对应的相关接口
 * @Author: lhb
 * @Date: 2025/7/9
 */
@RestController
@RequestMapping("/recruiter/seeker")
@Tag(name = "招聘者-推荐牛人控制器",description = "招聘者推荐牛人服务对应的相关接口")
public class RecruiterSeekerController {


    private final RecruiterSeekerService recruiterSeekerService;

    public RecruiterSeekerController(RecruiterSeekerService recruiterSeekerService) {
        this.recruiterSeekerService = recruiterSeekerService;
    }

    @Operation(summary = "获取牛人列表",description = "跨服务调用，调用方.")
    @ApiResponse(description = "无")
    @PostMapping("/getGoodSeekerList")
    @RateLimit
    public Result<RCrossGetGoodSeekersResp> getGoodSeekerList(@Validated
                                                               @RequestBody
                                                                  RCrossGetGoodSeekerListReq req){
        return recruiterSeekerService.getGoodSeekerList(req);
    }

    @Operation(summary = "对求职者感兴趣",description = "无")
    @ApiResponse(description = "返回token")
    @PostMapping("/interestedSeeker")
    public Result<Object> interestedSeeker(@Parameter(description = "用户userId", required = true)
                                               @RequestParam Long userId){
        return recruiterSeekerService.interestedSeeker(userId);
    }

    @Operation(summary = "获取感兴趣列表",description = "无")
    @ApiResponse(description = "无")
    @GetMapping("/getInterestedSeekerList")
    public Result<List<InterestedSeekerResp>> getInterestedSeekerList(){
        return recruiterSeekerService.getInterestedSeekerList();
    }
}
